import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import Welcome from '@/views/welcome/Welcome'
import User from '@/views/user/User'
import Roles from '@/views/right/Roles'
import Right from '@/views/right/Rights'
import Catagrory from '@/views/categrory/Categrory'
import Goods from '@/views/goods/Goods'
import AddGoods from '@/views/goods/AddGoods'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Home',
      redirect:{path:"welcome"},
      component: Home,
      children:[
        {path: "welcome", name: "Welcome", component:Welcome},
        {path: "users", name: "Users", component:User},
        {path: "roles", name: "Roles", component: Roles},
        {path: "rights", name: "Right", component: Right},
        {path: "categories", name: "categrories", component: Catagrory},
        {path: "goods", name: "Goods", component: Goods},
        {path: "toadd", name: "AddGoods", component: AddGoods},
      ]
    },
  ]
})
